﻿@using CleanArchitecture.Core.Helper
@using CleanArchitecture.Infrastructure.Models.AdminUsers
@using System.Text.RegularExpressions
@model AdminUserModel
@{ 
    var displayMobile = Regex.Replace(Model.Mobile, "(\\d{3})\\d{4}(\\d{4})", "$1 **** $2");
    var displayEmail = Regex.Replace(Model.Email, @"(?<=\S\S*?)[^@\s](?=\S*?@\S+)", "*");
}
<div id="accountsecurity" class="layui-card layui-hide">
    <div class="layui-card-header">安全设置</div>
    <div class="layui-card-body">
        <div class="layui-row layui-col-space5">
            <div class="layui-form" lay-filter="">
                <div class="layui-form-item">
                    <label class="layui-form-label">@(ReflectionExtensions.GetPropertyDisplayName<AdminUserModel>(m => m.OldPassword))</label>
                    <div class="layui-input-inline">
                        <span name="passwordstrong">@Model.PasswordStrongLevel</span>
                    </div>
                    <a href="javascript:;" id="changePassword" data-id="@Model.Id" style="float: right;">修改</a>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">@(ReflectionExtensions.GetPropertyDisplayName<AdminUserModel>(m => m.Mobile))</label>
                    <div class="layui-input-inline">
                        <span>@displayMobile</span>
                    </div>
                    <a href="javascript:;" id="changeMobile" style="float: right;" data-id="@Model.Id" data-origindata='@Model.Mobile'>修改</a>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">@(ReflectionExtensions.GetPropertyDisplayName<AdminUserModel>(m => m.Email))</label>
                    <div class="layui-input-inline">
                        <span>@displayEmail</span>
                    </div>
                    <a href="javascript:;" id="changeEmail" style="float: right;" data-id="@Model.Id" data-origindata='@Model.Email'>修改</a>
                </div>
            </div>
        </div>
    </div>
</div>